Resource allocation method and communications terminal

ABSTRACT

A resource allocation method and a communications terminal are provided. The communications terminal includes a radio frequency (RF) system and a baseband processor, the baseband processor includes: a radio resource manager (RRM) and at least two modems, and the at least two modems include a first modem and a second modem; and the RRM is configured to: receive a service request that is of a first service and that is initiated by the first modem; receive a service request that is of a second service and that is initiated by the second modem, where the first service and the second service are configured to preempt a communication resource; and when determining that currently a conflict exists between the first service and the second service, compare a first dynamic priority of the first service with a second dynamic priority of the second service to allocate the communication resource.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201610232142.X, filed on Apr. 14, 2016, which is hereby incorporated byreference in its entirety.

TECHNICAL FIELD

Embodiments of the present invention relate to the field of mobilecommunications technologies, and in particular, to a resource allocationmethod and a communications terminal.

BACKGROUND

With rapid development of communications technologies, people exchangeinformation with each other more frequently, and one mobile phone can nolonger meet people's requirements. Especially, people who work in salesor management sometimes need two or three or even more mobile phones tomeet requirements. However, it is quite inconvenient to carry so manymobile phones. Therefore, a multiple-card multiple-standby mobile phoneemerges in the market. With such a mobile phone, a user needs only onemobile phone in which multiple subscriber identity modules may beinstalled, which is obviously much more convenient than to carrymultiple mobile phones.

In the prior art, in a multiple-card multiple-standby single-passsystem, multiple mobile phone cards are continually switched betweenmultiple networks of the multiple cards by using one set ofcommunications module (including a radio frequency transceiver module,bottom-layer software, a control chip, and the like), to implementmultiple-card multiple-standby in multiple communications modes(communications standards). Because switching occurs very fast, forexample, each time of switching takes 1/1000 millisecond, a user cannotperceive that network switching occurs, and it is equivalent to thatimplementing simultaneous standby networking of multiple cards. In anactual application, if one card is performing a service, the card may bebriefly referred to as a service card. The rest cards are in a standbystate, and may be briefly referred to as non-service cards. Whenperforming a service, a service card receives and sends communicationssignaling or data, and to maintain a standby function, a non-servicecard needs to keep receiving a broadcast message and a paging message.In addition, the non-service card further needs to perform cellmeasurement when the service card is performing a service. Therefore, aconflict exists between sending and receiving of multiple cards.However, fixed priorities are adopted in a resource allocation method inthe prior art. When a conflict exists between resources that differentcards apply for, a resource allocation module performs allocationaccording to a priority of a service. A service with a high priorityobtains a resource first, and a service with a low priority obtains aresource later. When services for which application is separately madeby two cards have a same priority, allocation is performed according toa sequence of the cards. For example, allocation is performed accordingto a sequence of a modem 1 and a modem 2. Each time the modem 1 and themodem2 make application for services simultaneously, a service of themodem 1 may always be allocated, while a service of the modem 2 alwayscannot be allocated. Consequently, a service conflict cannot be resolvedproperly, and it is very likely to cause a call drop, a networkdisconnection or the like because the modem 2 obtains no resource for along time, and user experience is severely affected.

SUMMARY

A technical problem to be resolved by embodiments of the presentinvention is how to provide a resource allocation method and acommunications terminal, to resolve a problem in the prior art that anetwork disconnection of a service card or a non-service card in amultiple-card multiple-standby communications system may be caused by asending and receiving conflict between the service card and thenon-service card.

According to a first aspect, an embodiment of the present inventionprovides a communications terminal, where the terminal may include aradio frequency (RF) system and a baseband processor, where the basebandprocessor is connected to the RF system, the baseband processor mayinclude: a radio resource manager (RRM) and at least two modems, and theat least two modems include a first modem and a second modem;

the first modem is configured to process a first service of a firstsubscriber identity module SIM card;

the second modem is configured to process a second service of a secondSIM card; and

the RRM is configured to:

receive a service request that is of the first service and that isinitiated by the first modem;

receive a service request that is of the second service and that isinitiated by the second modem, where the first service and the secondservice are configured to preempt a communication resource; and

when determining that currently a conflict exists between the firstservice and the second service, compare a first dynamic priority of thefirst service with a second dynamic priority of the second service toallocate the communication resource to one of the first service and thesecond service, where the communication resource includes a resourceformed by the RF system, each of the first service and the secondservice is a current service, and the RRM is further configured tocalculate a dynamic priority of the current service according to aninitial priority of the current service and a dynamic service adjustmentparameter.

By means of the solution provided in this embodiment of the presentinvention, a priority of service resource allocation in a multiple-cardmultiple-standby single-pass system is not only related to a fixedinitial priority, but also related to a service execution state or aservice type, and dynamically changes according to an actualrequirement, thereby effectively avoiding that when there is a serviceconflict, a service with a relatively low initial priority isdisconnected from a network because no resource is allocated to theservice for a long time, and improving user experience.

With reference to the first aspect, in a first possible implementationmanner, the RF system includes a radio frequency integrated circuitRFIC, and the RFIC is configured to modulate or demodulate an RF signalrelated to a service processed by any one of the at least two modems.

With reference to the first possible implementation manner of the firstaspect, in a second possible implementation manner, the RF systemfurther includes an antenna and a radio frequency front end RFFE, theantenna is connected to the radio frequency front end RFFE, the RFFE isconnected to the RFIC, and the RFFE receives or sends the RF signal byusing the antenna.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in athird possible implementation manner, the dynamic service adjustmentparameter includes a successive allocation failure count, the successiveallocation failure count refers to a quantity of successive failures inapplying for the communication resource to be allocated to the currentservice, and upon a success in applying for the communication resourceto be allocated, the successive allocation failure count is reset tozero; and during calculation of the dynamic priority of the currentservice, the RRM is further configured to:

when determining that the current service meets any one condition in thefollowing, calculate the dynamic priority of the current serviceaccording to the initial priority of the current service and thesuccessive allocation failure count, where when the successiveallocation failure count is 0, the calculated dynamic priority is equalto the initial priority; or when the successive allocation failure countis greater than 0, the calculated dynamic priority is higher than theinitial priority, and the dynamic priority increases with the increaseof the successive allocation failure count; and

the any one condition includes:

the current service is a service with a fixed start moment, or a servicewithout a fixed start moment and with infinite duration; or

the current service is a service without a fixed start moment and withfinite duration, and the dynamic priority of the current service remainswithin a third priority range within a first preset time period after aservice request is initiated, where the initial priority of the currentservice is within a first priority range, and a priority correspondingto the third priority range is lower than a priority corresponding tothe first priority range; or

the dynamic priority of the current service is within a second priorityrange, and the RRM receives a service protection removal notificationfor the current service, where the service protection removalnotification instructs to adjust the dynamic priority of the currentservice from the second priority range to a first priority range, and apriority corresponding to the second priority range is higher than apriority corresponding to the first priority range.

By means of the solution provided in this embodiment of the presentinvention, a priority of service resource allocation in a multiple-cardmultiple-standby single-pass system is not only related to a fixedinitial priority, but also may be related to a successive allocationfailure count of a service resource, where a larger successiveallocation failure count indicates that a calculated dynamic priority ishigher, so as to resolve a problem that a resource still cannot beallocated to a service after multiple failures of resource allocation.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in afourth possible implementation manner, during calculation of the dynamicpriority of the current service, the RRM is further configured to:

calculate the first dynamic priority according to a first calculationformula, where the first calculation formula is: F=C−(C−D)*(A/B), whereF is a dynamic priority, C is an initial priority and is within a firstpriority range, D is a highest priority within the first priority range,A is a successive allocation failure count, B is a maximum threshold ofthe successive allocation failure count, a priority of C is lower thanthat of D, and A is less than B.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in afifth possible implementation manner, the current service is a servicewith infinite duration, and the RRM is further configured to:

when any one condition in the following is met, adjust the dynamicpriority of the current service to a highest priority within a firstpriority range, where the initial priority of the current service iswithin the first priority range; and

the any one condition includes:

after the communication resource has been allocated to the currentservice, a single preemption time of the communication resource byanother service except the current service within a preemptionstatistical period exceeds a first threshold, where the preemptionstatistical period is a second preset time period from a time at whichthe preemption of the communication resource by the another serviceexcept the current service starts to a time at which the preemptionends; or

after the communication resource has been allocated to the currentservice, a total time during which the communication resource ispreempted by another service except the current service exceeds a secondthreshold.

By means of the solution provided in this embodiment of the presentinvention, after a resource is allocated to a service with infiniteduration in a multiple-card multiple-standby single-pass system by usinga dynamic priority, after a time during which the service is preemptedor interrupted by another service exceeds a particular period of time,the dynamic priority of the service can be directly increased to ahigher level, to avoid a problem that the service fails to be executedbecause the service stays preempted or interrupted by the anotherservice.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in asixth possible implementation manner, the initial priority of thecurrent service is within a first priority range; the dynamic serviceadjustment parameter includes a first protection priority; and duringthe calculation of the dynamic priority of the current service, the RRMis further configured to:

when a service protection notification for the current service isreceived, calculate the dynamic priority of the current serviceaccording to the obtained initial priority and the first protectionpriority, where the service protection notification is used to instructto ensure that the communication resource is allocated to the currentservice, the first protection priority is a highest priority within thefirst priority range, the calculated dynamic priority of the currentservice is within a second priority range, and a priority correspondingto the second priority range is higher than a priority corresponding tothe first priority range.

By means of the solution provided in this embodiment of the presentinvention, a dynamic priority of a service on which radio frequencyprotection needs to be performed and that is in a multiple-cardmultiple-standby single-pass system can be directly increased to ahigher level, to ensure successful execution of the service.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in aseventh possible implementation manner, during the calculation of thedynamic priority of the current service, the RRM is further configuredto:

when a service protection notification for the current service isreceived, calculate the dynamic priority of the current serviceaccording to a second calculation formula, where the service protectionnotification is used to instruct to ensure that the communicationresource is allocated to the current service, and the second calculationformula is: F=E+(C/N), where F is a dynamic priority, C is an initialpriority and is within a first priority range, E is a highest prioritywithin the first priority range, and N is a natural number greater than1.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in aneighth possible implementation manner, the current service is a servicewithout a fixed start moment and with finite duration; the dynamicservice adjustment parameter includes a protection removal priority; andduring the calculation of the dynamic priority of the current service,the RRM is further configured to:

calculate the dynamic priority of the current service according to theobtained initial priority and the protection removal priority, where theinitial priority of the current service is within a first priorityrange, the protection removal priority is a lowest priority within thefirst priority range, the calculated dynamic priority of the currentservice is within a third priority range, and a priority correspondingto the third priority range is lower than a priority corresponding tothe first priority range.

By means of the solution provided in this embodiment of the presentinvention, when radio frequency protection no longer needs to beperformed on a service on which radio frequency protection has beenperformed and that is in a multiple-card multiple-standby single-passsystem, a dynamic priority of the service can be reduced to a normallevel.

With reference to the third possible implementation manner of the firstaspect, or with reference to the sixth possible implementation manner ofthe first aspect, or with reference to the eighth possibleimplementation manner of the first aspect, in a ninth possibleimplementation manner, the calculated dynamic priority increases withthe increase of the initial priority of the current service.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in atenth possible implementation manner, the current service is a servicewithout a fixed start moment and with finite duration; and during thecalculation of the dynamic priority of the current service, the RRM isfurther configured to:

calculate the dynamic priority of the current service according to athird calculation formula, where the third calculation formula is:F=E+(C/N), where F is a dynamic priority, C is an initial priority andis within a first priority range, E is a lowest priority within thefirst priority range, and N is a natural number greater than 1.

With reference to the first aspect, or with reference to the firstpossible implementation manner of the first aspect, or with reference tothe second possible implementation manner of the first aspect, in aneleventh possible implementation manner, the current service is aperiodic service, the periodic service includes services at multipletime points, and an interval between services at adjacent time points isa period of the periodic service; and the RRM is further configured to:

calculate a dynamic priority of a service at an M^(th) time pointaccording to the initial priority of the current service and asuccessive allocation failure count of a service between a first timepoint and an (M−2)^(th) time point, where an interval between the(M−2)^(th) time point and the M^(th) time point is two periods of theperiodic service, and M is a natural number greater than 3, where whenthe successive allocation failure count of the service between the firsttime point and the (M−2)t^(h) time point is 0, the calculated dynamicpriority of the service at the M^(th) time point is equal to an initialpriority of the periodic service; or when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is greater than 0, the calculated dynamic priorityof the service at the M^(th) time point is higher than the initialpriority, and the dynamic priority increases with the increase of thesuccessive allocation failure count.

By means of the solution provided in this embodiment of the presentinvention, for a periodic service in a multiple-card multiple-standbysingle-pass system, when a resource fails to be allocated to a periodicservice at one time point, a dynamic priority can be increasedappropriately for a periodic service at a time point after a next timepoint of the time point, so that a resource can be successfullyallocated to the periodic service.

According to a second aspect, an embodiment of the present inventionprovides a resource allocation apparatus, applied to a terminalincluding a RF system and a baseband processor, where the basebandprocessor includes a RRM and at least two modems, the at least twomodems include a first modem and a second modem, and the apparatus mayinclude:

a receiving module, configured to receive a service request that is of afirst service and that is initiated by the first modem, where the firstmodem is configured to process a first service of a first subscriberidentity module SIM card;

an allocation module, configured to: when determining that therecurrently exists a second service that is initiated by the second modemand that is in a conflict with the first service in preempting acommunication resource, compare a first dynamic priority of the firstservice with a second dynamic priority of the second service to allocatethe communication resource to one of the first service and the secondservice, where the second modem is configured to process the secondservice of a second SIM card, the communication resource includes aresource formed by the RF system, each of the first service and thesecond service is a current service, and a dynamic priority of thecurrent service is calculated by the RRM according to an initialpriority of the current service and a dynamic service adjustmentparameter.

With reference to the second aspect, in a first possible implementationmanner, the dynamic service adjustment parameter includes a successiveallocation failure count, the successive allocation failure count refersto a quantity of successive failures in applying for the communicationresource to be allocated to the current service, and upon a success inapplying for the communication resource to be allocated, the successiveallocation failure count is reset to zero; and the apparatus furtherincludes:

a first priority calculation module, configured to: when determiningthat the current service meets any one condition in the following,calculate the dynamic priority of the current service according to theinitial priority of the current service and the successive allocationfailure count, where when the successive allocation failure count is 0,the calculated dynamic priority is equal to the initial priority; orwhen the successive allocation failure count is greater than 0, thecalculated dynamic priority is higher than the initial priority, and thedynamic priority increases with the increase of the successiveallocation failure count; and

the any one condition includes:

the current service is a service with a fixed start moment, or a servicewithout a fixed start moment and with infinite duration; or

the current service is a service without a fixed start moment and withfinite duration, and the dynamic priority of the current service remainswithin a third priority range within a first preset time period after aservice request is initiated, where the initial priority of the currentservice is within a first priority range, and a priority correspondingto the third priority range is lower than a priority corresponding tothe first priority range; or

the dynamic priority of the current service is within a second priorityrange, and the RRM receives a service protection removal notificationfor the current service, where the service protection removalnotification instructs to adjust the dynamic priority of the currentservice from the second priority range to a first priority range, and apriority corresponding to the second priority range is higher than apriority corresponding to the first priority range.

With reference to the second aspect, in a second possible implementationmanner, the apparatus further includes:

a first calculation module, configured to calculate the first dynamicpriority according to a first calculation formula, where the firstcalculation formula is: F=C−(C−D)*(A/B), where F is a dynamic priority,C is an initial priority and is within a first priority range, D is ahighest priority within the first priority range, A is a successiveallocation failure count, B is a maximum threshold of the successiveallocation failure count, a priority of C is lower than that of D, and Ais less than B.

With reference to the second aspect, in a third possible implementationmanner, the current service is a service with infinite duration, and theapparatus further includes:

a second priority calculation module, configured to: when any onecondition in the following is met, adjust the dynamic priority of thecurrent service to a highest priority within a first priority range,where the initial priority of the current service is within the firstpriority range; and

the any one condition includes:

after the communication resource has been allocated to the currentservice, a time for which the communication resource is preempted byanother service except the current service for a single time within apreemption statistical period exceeds a first threshold, where thepreemption statistical period is a second preset time period from a timeat which the preemption of the communication resource by the anotherservice except the current service starts to a time at which thepreemption ends; or

after the communication resource has been allocated to the currentservice, a total time during which the communication resource ispreempted by another service except the current service exceeds a secondthreshold.

With reference to the second aspect, in a fourth possible implementationmanner, the initial priority of the current service is within a firstpriority range, and the dynamic service adjustment parameter includes afirst protection priority; and the apparatus further includes:

a third priority calculation module, configured to: when a serviceprotection notification for the current service is received, calculatethe dynamic priority of the current service according to the obtainedinitial priority and the first protection priority, where the serviceprotection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, the firstprotection priority is a highest priority within the first priorityrange, the calculated dynamic priority of the current service is withina second priority range, and a priority corresponding to the secondpriority range is higher than a priority corresponding to the firstpriority range.

With reference to the second aspect, in a second possible implementationmanner, the apparatus further includes:

a second calculation module, configured to: when a service protectionnotification for the current service is received, calculate the dynamicpriority of the current service according to a second calculationformula, where the service protection notification is used to instructto ensure that the communication resource is allocated to the currentservice, and the second calculation formula is: F=E+(C/N), where F is adynamic priority, C is an initial priority and is within a firstpriority range, E is a highest priority within the first priority range,and N is a natural number greater than 1.

With reference to the second aspect, in a sixth possible implementationmanner, the current service is a service without a fixed start momentand with finite duration; the dynamic service adjustment parameterincludes a protection removal priority; and the apparatus furtherincludes:

a fourth priority calculation module, configured to calculate thedynamic priority of the current service according to the obtainedinitial priority and the protection removal priority, where the initialpriority of the current service is within a first priority range, theprotection removal priority is a lowest priority within the firstpriority range, the calculated dynamic priority of the current serviceis within a third priority range, and a priority corresponding to thethird priority range is lower than a priority corresponding to the firstpriority range.

With reference to the first possible implementation manner of the secondaspect, or with reference to the fourth possible implementation mannerof the second aspect, or with reference to the sixth possibleimplementation manner of the second aspect, in a seventh possibleimplementation manner, the calculated dynamic priority increases withthe increase of the initial priority of the current service.

With reference to the second aspect, in an eighth possibleimplementation manner, the current service is a service without a fixedstart moment and with finite duration, and the apparatus furtherincludes:

a third calculation module, configured to calculate the dynamic priorityof the current service according to a third calculation formula, wherethe third calculation formula is: F=E+(C/N), where F is a dynamicpriority, C is an initial priority and is within a first priority range,E is a lowest priority within the first priority range, and N is anatural number greater than 1.

With reference to the second aspect, in a ninth possible implementationmanner, the current service is a periodic service, the periodic serviceincludes services at multiple time points, and an interval betweenservices at adjacent time points is a period of the periodic service;and the apparatus further includes:

a fifth priority calculation module, configured to calculate a dynamicpriority of a service at an M^(th) time point according to the initialpriority of the current service and a successive allocation failurecount of a service between a first time point and an (M−2)^(th) timepoint, where an interval between the (M−2)^(th) time point and the Mttime point is two periods of the periodic service, and M is a naturalnumber greater than 3, where when the successive allocation failurecount of the service between the first time point and the (M−2)^(th)time point is 0, the calculated dynamic priority of the service at theM^(th) time point is equal to an initial priority of the periodicservice; or when the successive allocation failure count of the servicebetween the first time point and the (M−2)^(th) time point is greaterthan 0, the calculated dynamic priority of the service at the Mal timepoint is higher than the initial priority, and the dynamic priorityincreases with the increase of the successive allocation failure count.

According to a third aspect, an embodiment of the present inventionprovides a resource allocation method, applied to a terminal including aRF system and a baseband processor, where the baseband processorincludes a RRM and at least two modems, the at least two modems includea first modem and a second modem, and the method may include:

receiving, by the RRM, a service request that is of a first service andthat is initiated by the first modem, where the first modem isconfigured to process a first service of a first subscriber identitymodule SIM card;

when the RRM determines that there currently exists a second servicethat is initiated by the second modem and that is in a conflict with thefirst service in preempting a communication resource, comparing a firstdynamic priority of the first service with a second dynamic priority ofthe second service to allocate the communication resource to one of thefirst service and the second service, where the second modem isconfigured to process the second service of a second SIM card, thecommunication resource includes a resource formed by the RF system, eachof the first service and the second service is a current service, and adynamic priority of the current service is calculated by the RRMaccording to an initial priority of the current service and a dynamicservice adjustment parameter.

With reference to the third aspect, in a first possible implementationmanner, the dynamic service adjustment parameter includes a successiveallocation failure count, the successive allocation failure count refersto a quantity of successive failures in applying for the communicationresource to be allocated to the current service, and upon a success inapplying for the communication resource to be allocated, the successiveallocation failure count is reset to zero; and the method furtherincludes:

when the RRM determines that the current service meets any one conditionin the following, calculating, by the RRM, the dynamic priority of thecurrent service according to the initial priority of the current serviceand the successive allocation failure count, where when the successiveallocation failure count is 0, the calculated dynamic priority is equalto the initial priority; or when the successive allocation failure countis greater than 0, the calculated dynamic priority is higher than theinitial priority, and the dynamic priority increases with the increaseof the successive allocation failure count; and

the any one condition includes:

the current service is a service with a fixed start moment, or a servicewithout a fixed start moment and with infinite duration; or

the current service is a service without a fixed start moment and withfinite duration, and the dynamic priority of the current service remainswithin a third priority range within a first preset time period after aservice request is initiated, where the initial priority of the currentservice is within a first priority range, and a priority correspondingto the third priority range is lower than a priority corresponding tothe first priority range; or

the dynamic priority of the current service is within a second priorityrange, and the RRM receives a service protection removal notificationfor the current service, where the service protection removalnotification instructs to adjust the dynamic priority of the currentservice from the second priority range to a first priority range, and apriority corresponding to the second priority range is higher than apriority corresponding to the first priority range.

With reference to the third aspect, in a second possible implementationmanner, the method further includes:

calculating, by the RRM, the first dynamic priority according to a firstcalculation formula, where the first calculation formula is:F=C−(C−D)*(A/B), where F is a dynamic priority, C is an initial priorityand is within a first priority range, D is a highest priority within thefirst priority range, A is a successive allocation failure count, B is amaximum threshold of the successive allocation failure count, a priorityof C is lower than that of D, and A is less than B.

With reference to the third aspect, in a third possible implementationmanner, the current service is a service with infinite duration, and themethod further includes:

when any one condition in the following is met, adjusting, by the RRM,the dynamic priority of the current service to a highest priority withina first priority range, where the initial priority of the currentservice is within the first priority range; and

the any one condition includes:

after the communication resource has been allocated to the currentservice, a time for which the communication resource is preempted byanother service except the current service for a single time within apreemption statistical period exceeds a first threshold, where thepreemption statistical period is a second preset time period from a timeat which the preemption of the communication resource by the anotherservice except the current service starts to a time at which thepreemption ends; or

after the communication resource has been allocated to the currentservice, a total time during which the communication resource ispreempted by another service except the current service exceeds a secondthreshold.

With reference to the third aspect, in a fourth possible implementationmanner, the initial priority of the current service is within a firstpriority range; the dynamic service adjustment parameter includes afirst protection priority; and the method further includes:

when the RRM receives a service protection notification for the currentservice, calculating, by the RRM, the dynamic priority of the currentservice according to the obtained initial priority and the firstprotection priority, where the service protection notification is usedto instruct to ensure that the communication resource is allocated tothe current service, the first protection priority is a highest prioritywithin the first priority range, the calculated dynamic priority of thecurrent service is within a second priority range, and a prioritycorresponding to the second priority range is higher than a prioritycorresponding to the first priority range.

With reference to the third aspect, in a fifth possible implementationmanner, the method further includes:

when the RRM receives a service protection notification for the currentservice, calculating, by the RRM, the dynamic priority of the currentservice according to a second calculation formula, where the serviceprotection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, and thesecond calculation formula is: F=E+(C/N), where F is a dynamic priority,C is an initial priority and is within a first priority range, E is ahighest priority within the first priority range, and N is a naturalnumber greater than 1.

With reference to the third aspect, in a sixth possible implementationmanner, the current service is a service without a fixed start momentand with finite duration; the dynamic service adjustment parameterincludes a protection removal priority; and the method further includes:

calculating, by the RRM, the dynamic priority of the current serviceaccording to the obtained initial priority and the protection removalpriority, where the initial priority of the current service is within afirst priority range, the protection removal priority is a lowestpriority within the first priority range, the calculated dynamicpriority of the current service is within a third priority range, and apriority corresponding to the third priority range is lower than apriority corresponding to the first priority range.

With reference to the first possible implementation manner of the thirdaspect, or with reference to the fourth possible implementation mannerof the third aspect, or with reference to the sixth possibleimplementation manner of the third aspect, in a seventh possibleimplementation manner, the calculated dynamic priority increases withthe increase of the initial priority of the current service.

With reference to the third aspect, in an eighth possible implementationmanner, the current service is a service without a fixed start momentand with finite duration, and the method further includes:

calculating, by the RRM, the dynamic priority of the current serviceaccording to a third calculation formula, where the third calculationformula is: F=E+(C/N), where F is a dynamic priority, C is an initialpriority and is within a first priority range, E is a lowest prioritywithin the first priority range, and N is a natural number greater than1.

With reference to the third aspect, in a ninth possible implementationmanner, the current service is a periodic service, the periodic serviceincludes services at multiple time points, and an interval betweenservices at adjacent time points is a period of the periodic service;and the method further includes:

calculating, by the RRM, a dynamic priority of a service at an M^(th)time point according to the initial priority of the current service anda successive allocation failure count of a service between a first timepoint and an (M−2)^(th) time point, where an interval between the(M−2)^(th) time point and the M^(th) time point is two periods of theperiodic service, and M is a natural number greater than 3, where whenthe successive allocation failure count of the service between the firsttime point and the (M−2)^(th) time point is 0, the calculated dynamicpriority of the service at the M^(th) time point is equal to an initialpriority of the periodic service; or when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is greater than 0, the calculated dynamic priorityof the service at the M^(th) time point is higher than the initialpriority, and the dynamic priority increases with the increase of thesuccessive allocation failure count.

Implementation of the embodiments of the present invention has thefollowing beneficial effect:

In the embodiments of the present invention, a communications terminalis provided and includes a RF system and a baseband processor, where thebaseband processor is connected to the RF system, the baseband processorincludes: a RRM and at least two modems; the RRM is configured to: whendetermining that currently a conflict exists between a first service anda second service, compare a first dynamic priority of the first servicewith a second dynamic priority of the second service to allocate acommunication resource to one of the first service and the secondservice; the at least two modems include a first modem and a secondmodem, where the first modem is configured to process the first serviceof a first subscriber identity module SIM card, the second modem isconfigured to process a second service of a second SIM card, the firstservice and the second service are configured to preempt a communicationresource, each of the first service and the second service is a currentservice, and the RRM is further configured to calculate a dynamicpriority of the current service according to an initial priority of thecurrent service and a dynamic service adjustment parameter. Thecommunications terminal provided in the present invention resolves aproblem in the prior art that improper resource allocation is easilycaused because a multiple-card multiple-standby single-pass systemallocates a communication resource according to only a principle ofperforming allocation by using an initial fixed priority of a service,and avoids a problem such as a call drop or a network disconnectionbecause no resource is allocated to the service for a long time, therebyimproving user experience.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention or in the prior art more clearly, the following brieflydescribes the accompanying drawings required for describing theembodiments or the prior art. Apparently, the accompanying drawings inthe following description show merely some embodiments of the presentinvention, and persons of ordinary skill in the art may still deriveother drawings from these accompanying drawings without creativeefforts.

FIG. 1 is a schematic structural diagram of a communications terminalaccording to an embodiment of the present invention;

FIG. 2 is a schematic flowchart of a resource allocation methodaccording to an embodiment of the present invention;

FIG. 3 is a schematic diagram of a specific application scenario of aresource allocation method according to an embodiment of the presentinvention;

FIG. 4 is a schematic diagram of another specific application scenarioof a resource allocation method according to an embodiment of thepresent invention;

FIG. 5 is a schematic diagram of still another specific applicationscenario of a resource allocation method according to an embodiment ofthe present invention;

FIG. 6 is a schematic diagram of yet another specific applicationscenario of a resource allocation method according to an embodiment ofthe present invention;

FIG. 7 is a schematic structural diagram of a resource allocationapparatus according to an embodiment of the present invention;

FIG. 8 is a schematic structural diagram of another embodiment of aresource allocation apparatus according to the present invention;

FIG. 9 is a schematic structural diagram of still another embodiment ofa resource allocation apparatus according to the present invention;

FIG. 10 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention;

FIG. 11 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention;

FIG. 12 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention;

FIG. 13 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention;

FIG. 14 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention; and

FIG. 15 is a schematic structural diagram of yet another embodiment of aresource allocation apparatus according to the present invention.

DESCRIPTION OF EMBODIMENTS

The following clearly and completely describes the technical solutionsin the embodiments of the present invention with reference to theaccompanying drawings in the embodiments of the present invention.Apparently, the described embodiments are merely some but not all of theembodiments of the present invention. All other embodiments obtained bypersons of ordinary skill in the art based on the embodiments of thepresent invention without creative efforts shall fall within theprotection scope of the present invention.

It should be noted that the terms used in the embodiments of the presentinvention are merely for the purpose of illustrating specificembodiments, and are not intended to limit the present invention. Itshould be understood that, terms such as first and second are used todescribe message services or modules in this specification, but thesemessage services or modules should not be limited by these terms, andthese terms are only used to distinguish these message services ormodules. It should be further understood that, unless the contextclearly supports an exception, a singular form “one” (“a”, “an”, and“the”) used in this specification is intended to include a plural form.It should be further understood that, “and/or” used in thisspecification refers to that any one combination or all possiblecombinations of one or more listed related items.

A communications terminal in the embodiments of the present inventionincludes, but is not limited to, user equipment such as a smart mobilephone on which multiple subscriber identity module SIM cards can beoperated, a tablet computer, a media player, an intelligent television,a smart band, a smart wearable device, an MP3 (Moving Picture ExpertsGroup Audio Layer III, Moving Picture Experts Group Audio Layer III)player, an MP4 (Moving Picture Experts Group Audio Layer IV, MovingPicture Experts Group Audio Layer IV) player, a personal digitalassistant (Personal Digital Assistant, PDA), or a laptop computer. Userequipment configured for communication can work in various types ofwireless communications standards, and each wireless communicationsstandard may be applied to a communications system, for example: aglobal system for mobile communications (Global System of Mobilecommunication, “GSM” for short) system, a code division multiple access(Code Division Multiple Access, “CDMA” for short) system, a widebandcode division multiple access (Wideband Code Division Multiple Access,“WCDMA” for short) system, a general packet radio service (GeneralPacket Radio Service, “GPRS” for short), a long term evolution (LongTerm Evolution, “LTE” for short) system, an LTE frequency divisionduplex (Frequency Division Duplex, “FDD” for short) system, LTE timedivision duplex (Time Division Duplex, “TDD” for short), a universalmobile telecommunications system (Universal Mobile TelecommunicationSystem, “UMTS” for short), or a worldwide interoperability for microwaveaccess (Worldwide Interoperability for Microwave Access, “WiMAX” forshort) communications system, and may also be applied to a system thatmay appear in the future.

To better understand the embodiments of the present invention, thefollowing first describes a structure of a communications terminal inthe embodiments of the present invention. Referring to FIG. 1, FIG. 1 isa schematic structural diagram of a communications terminal 10 accordingto an embodiment of the present invention. As shown in FIG. 1, thecommunications terminal may include a radio frequency (Radio Frequency,RF) system 11 and a baseband processor 12, where the baseband processor12 is connected to the RF system 11, the RF system 11 may include atleast one of an antenna 111, a radio frequency front end (RadioFrequency Front End, RFFE) 112 or a radio frequency integrated circuit(Radio Frequency Integrated Circuits, RFIC) 113. In a possibleimplementation manner, the RF system 11 includes a radio frequencyintegrated circuit RFIC 113, and the RFIC 113 is configured to modulateor demodulate an RF signal related to a service processed by any one ofat least two modems (a first modem 121 and a second modem 122). Further,the RF system 11 further includes an antenna 111 and a radio frequencyfront end RFFE 112, where the antenna 111 is connected to the radiofrequency front end RFFE 112, the RFFE 112 is connected to the RFIC 113,and the RFFE 112 receives or sends the RF signal by using the antenna.It is assumed that the RF system 11 includes an antenna 111, an RFFE112, and an RFIC 113, where the RFFE 112 modulates, by using the RFIC113, a signal sent by the baseband processor 12 and transmits themodulated signal on the antenna (transmit channel), or the RFFE 112demodulates a received air interface signal by using the RFIC 113 andsends the demodulated signal to the baseband processor 12 at a back endfor communication protocol processing (receive channel). The RFFE 112specifically includes: a duplexer 1121 and a power amplifier (PowerAmplifier, PA) 1122. The duplexer 1121 is configured to couple both thetransmit channel and the receive channel (as shown by the arrowdirections) to the antenna, so that the antenna may perform sending orreceiving or both sending and receiving; and the PA 1122 is configuredto perform a power amplification function on a transmit signal on thetransmit channel, so that an amplified signal may be sent from theantenna. The RFIC 113 is a modulation and demodulation unit at a backend of the RFFE 112, where modulation is to convert a low-frequencysignal of a baseband on the transmit channel into a high-frequency RFsignal (that is, up-conversion, a function of which is implemented by anup-converter 1131 in FIG. 1), and demodulation is to demodulate ahigh-frequency RF signal on the receive channel into a baseband signal(that is, down-conversion, a function of which is implemented by adown-converter 1132 in FIG. 1). An up-/down-converter is a mixer, whichmixes a high-frequency RF signal and a local-frequency signal togenerate a baseband signal, or mixes a baseband signal and alocal-frequency signal to generate a high-frequency RF signal. Beforedemodulation is performed on the receive channel, an LNA 1132 a, thatis, a low noise amplifier, may be further included, and is used toperform amplification on a receive signal.

The baseband processor 12 mainly processes a baseband signal, and mayprocess various types of communications protocols such as 2/3/4/5G(generation, Generation). The baseband processor 12 mainly includes aradio resource manager (Radio Resource Management, RRM) 123 and at leasttwo modems, that is, a first modem 121 and a second modem 122. An effectof each modem is mainly processing a part of functions of communicatingwith a base station, including a part of functions related to a terminalmaking a call, sending an SNS message, and accessing the Internet (forexample, a data function of a communications standard such as GPRS,WCDMA, or LTE), such as at least one of channel encoding/decoding,precoding/decoding, MIMO (multiple-input multiple-output) processing, orsignal interleaving/de-interleaving processing. The RRM is includedinside the baseband processor, and is used to schedule an RF resourceapplied for by each modem, and the RRM calculates a dynamic priorityaccording to a parameter such as a service status and an initialpriority, and allocates communication resources (including an RFresource and a CPU (central processing unit) resource) according topriorities. A specific manner for calculating a dynamic priority isgiven in subsequent embodiments. The service involved in this embodimentor the subsequent embodiments is a wireless communication service, andgenerally may include at least one of a PS (packet switched) service ora CS service. For example, the service may be an operator voice service,a VoIP (voice over Internet protocol) service, a data downloading (fromthe base station to the communications terminal 10) and uploading (fromthe communications terminal 10 to the base station) service, or a shortmessaging service message service, and may selectively include a servicesuch as receiving system paging or system broadcast.

It may be understood that, the baseband processor 12 may further includea clock module, which is mainly configured to generate, for the basebandprocessor 12, a clock needed for data transmission and timing control;and may further include a power management module, which is mainlyconfigured to provide a stable and high-precision voltage to thebaseband processor 12, the radio frequency system 11, and a peripheralsystem. It may be further understood that, the communications terminal10 may further include a peripheral system, which is mainly configuredto implement an interaction function between the communications terminal10 and a user/an external environment. During specific implementation,the peripheral system may include: a display (LCD) controller, a cameracontroller, an audio controller, a touchscreen controller, and a sensormanagement module. Each controller may couple with a correspondingrespective peripheral device. In some embodiments, the peripheral systemmay further include another I/O peripheral controller or the like, whichis not specifically limited in the present invention.

The foregoing structure of the communications terminal in FIG. 1 is onlya preferred implementation manner of this embodiment of the presentinvention, and the structure of the communications terminal in thisembodiment of the present invention includes, but is not limited to, theforegoing structure, provided that a structure of a communicationsterminal of a multiple-card multiple-standby resource allocation methodin the present invention can fall within a scope protected and coveredby the present invention.

Referring to FIG. 2, FIG. 2 is a schematic flowchart of a resourceallocation method according to an embodiment of the present invention.The foregoing communications terminal in FIG. 1 is configured to supportand perform step S201 and step S202 of a method procedure shown in FIG.2. With reference to the communications terminal corresponding to FIG. 1and the method procedure corresponding to FIG. 2, the followingdescribes and illustrates in detail a specific action procedureperformed by and a corresponding function completed by thecommunications terminal 10 in the present invention on a side of an RRMin a baseband processor of the communications terminal.

S201: A RRM receives a service request that is of a first service andthat is initiated by a first modem.

Specifically, a hardware system of the communications terminal 10 onwhich this embodiment of the present invention is based is amultiple-card multiple-standby single-pass system; therefore, the systemmay include multiple modems (for example, multiple SIM (subscriberidentity module) cards may be inserted in a mobile phone). When only onemodem (corresponding to one SIM card) needs to perform a communicationservice, the RRM receives a service request sent by one modemcorresponding to one SIM card; and when multiple modems (each modemcorresponds to one SIM card) need to perform a communication service,the RRM receives a service request separately sent by multiple modemscorresponding to multiple SIM cards.

In this embodiment of the present invention, the first modem 121 isconfigured to process a first service of a first subscriber identitymodule SIM card, and the second modem 122 is configured to process asecond service of a second SIM card. The RRM 123 may be configured toreceive a service request that is of the first service and that isinitiated by the first modem 121, or may be configured to receive aservice request that is of the second service and that is initiated bythe second modem 122, where the first service and the second service areconfigured to preempt a communication resource. Because in thisembodiment of the present invention, there exists a service conflictbetween the first service and the second service, the following twocases are mainly included: The RRM 123 simultaneously receives theservice request of the first service and the service request of thesecond service; or when the RRM 123 receives the service request of thefirst service, the second service is being executed (is occupying thecommunication resource). It should be noted that, in the prior art, aservice conflict exists between services in application made bydifferent modems only, and there exists no service conflict betweenservices in application made by a same modem. It may be understood that,in each embodiment of the present invention, different modemscorresponding to different SIM cards may be based on differentcommunications standards or a same communications standard. Generally,the multiple modems correspond to different communications standards.For example, the first modem is applicable to a GSM standard, and thesecond modem is applicable to an LTE, WCDMA, TDSCDMA (Time DivisionSynchronous Code Division Multiple Access) or GSM standard.

S202: When the RRM determines that there currently exists a secondservice that is initiated by the second modem and that is in a conflictwith the first service in preempting a communication resource, compare afirst dynamic priority of the first service with a second dynamicpriority of the second service to allocate the communication resource toone of the first service and the second service.

Specifically, because in the prior art, a corresponding priority is setfor different modems or different services, and the priority is fixed,that is, no matter when or where or in which case application for acommunication resource is made for a service, the initial priority isfixed. In this embodiment of the present invention, for the technicalproblem, while an initial priority of a service is maintained, a dynamicservice adjustment parameter (which may include parameters such as anexecution state of the service, a type of the service, a current actualrequirement of the service, a level at which the service currently needsto be protected or does not need to be protected) is further added. Whendetermining that there currently exists a second service that isinitiated by the second modem 122 and that is in a conflict with thefirst service in preempting a communication resource, the RRM 123compares a first dynamic priority of the first service with a seconddynamic priority of the second service to allocate the communicationresource to one of the first service and the second service. That is,the communication resource is allocated sequentially according todynamic priorities of the second service and the first service, wherethe communication resource may include at least one of an RF systemresource, a CPU resource, or a system resource. When each of the firstservice and the second service is regarded as a current service, the RRM123 may be further configured to calculate a dynamic priority of thecurrent service according to an initial priority of the current service(the first service and/or the second service) and the dynamic serviceadjustment parameter. A specific calculation process is illustrated indetail in the subsequent embodiments. It should be stressed that in thepresent invention, calculation of the dynamic priority of the currentservice may be performed immediately after a service request of thecurrent service is received, or may be performed only when it isdetermined that a service conflict currently exists between anotherservice and the current service, which is not specifically limited inthe present invention, provided that the dynamic priority of the currentservice (such as the first service and the second service) may beobtained before resource allocation needs to be performed according tothe dynamic priority when there exists a service conflict. Details arenot described again in the subsequent embodiments of the presentinvention.

Next, how a RRM in the present invention calculates the dynamic priorityof the current service is illustrated in detail and described by usingan example:

In a possible implementation manner, the dynamic service adjustmentparameter includes a successive allocation failure count, the successiveallocation failure count refers to a quantity of successive failures inapplying for the communication resource to be allocated to the currentservice, and upon a success in applying for the communication resourceto be allocated, the successive allocation failure count is reset tozero. A process of calculating the dynamic priority of the currentservice by the RRM may be specifically: when the RRM determines that thecurrent service meets any one condition in the following, calculatingthe dynamic priority of the current service according to the initialpriority of the current service and the successive allocation failurecount, where when the successive allocation failure count is 0, thecalculated dynamic priority is equal to the initial priority; and whenthe successive allocation failure count is greater than 0, thecalculated dynamic priority is higher than the initial priority, and thedynamic priority increases with the increase of the successiveallocation failure count. That is, in this case, the dynamic priority ofthe service is mainly related to the successive allocation failure countof a service resource, and when a resource fails to be allocated to theservice multiple successive times, the priority of the service can beimproved appropriately, to prevent the service from staying in a stateof a vicious circle in which no resource is allocated to the servicebecause of a low initial priority.

The any one condition includes:

condition 1: the current service is a service with a fixed start moment(such as a demodulation paging service), or a service without a fixedstart moment and with infinite duration (such as a phone or a dataservice); or

condition 2: the current service is a service without a fixed startmoment and with finite duration (such as a group broadcast service or ameasurement report service that does not strictly require a serviceexecution time), and the dynamic priority of the current service remainswithin a third priority range (low priority range) within a first presettime period after a service request is initiated, where the initialpriority of the current service is within a first priority range (mediumpriority range), and a priority corresponding to the third priorityrange is lower than a priority corresponding to the first priorityrange; or

condition 3: the dynamic priority of the current service is within asecond priority range (on which radio frequency protection is performedand the dynamic priority is within a protected high priority range), andthe RRM receives a service protection removal notification for thecurrent service, where the service protection removal notificationinstructs to adjust the dynamic priority of the current service from thesecond priority range to a first priority range, and a prioritycorresponding to the second priority range is higher than a prioritycorresponding to the first priority range. That is, in this embodiment,the RRM previously receives the service protection notification for thecurrent service and performs corresponding dynamic priority protection(a priority is increased to the second priority range, that is, the highpriority range). When priority protection no longer needs to beperformed on the current service, after service protection is performed,service protection removal may be performed, and further, a dynamicpriority range of the current service is reduced from a high secondpriority range to a first priority protection range by using a relatedcalculation method (such as a first calculation formula mentionedsubsequently) of a dynamic priority. It should be noted that, firstcalculation formulas mentioned in the embodiments of the presentinvention may be regarded as a same calculation formula.

Further, when quantities of successive allocation failures of differentservices are the same, a calculated dynamic priority is larger for aservice with a higher initial priority, that is, when quantities ofsuccessive allocation failures of resources of different services arethe same, comparison and determining may be further performed accordingto initial priorities of the different services, and a resource may bepreferentially allocated to a service with a high initial priority. Itshould be noted that, parameters, such as the initial priority of thecurrent service and the successive allocation failures, obtained by theRRM may be related parameters carried in the service request that is ofthe current service and that is initiated by a related modem, or may beobtained by the RRM from a storage unit of the RRM according to indexinformation of related parameters, which is not specifically limited inthe present invention.

Further, the RRM calculates the first dynamic priority according to afirst calculation formula, where the first calculation formula isspecifically: F=C−(C−D)*(A/B), where F is a dynamic priority, C is aninitial priority and is within a first priority range, D is a highestpriority within the first priority range, A is a successive allocationfailure count, B is a maximum threshold of the successive allocationfailure count, a priority of C is lower than that of D, and A is lessthan B. It should be noted that, in the first calculation formula, boththe initial priority C and the parameter D belong to the first priorityrange, and a priority of D is higher than that of C. Therefore, when thequantity of successive failures is greater than 0, an eventuallycalculated dynamic priority of the current service is definitely greaterthan the initial priority.

By means of the solution provided in this embodiment of the presentinvention, a priority of service resource allocation in a multiple-cardmultiple-standby single-pass system is not only related to a fixedinitial priority, but also may be related to a successive allocationfailure count of a service resource, where a larger successiveallocation failure count indicates that a calculated dynamic priority ishigher, so as to resolve a problem that a resource still cannot beallocated to a service after multiple failures of resource allocation.

In a possible implementation manner, the current service is a servicewith infinite duration (such as a phone service or a data service),where a type of the service may be determined by the RRM according toattribute information carried in the service, or may be determinedaccording to a service application type, and the initial priority of thecurrent service is set within a priority range in which the firstpriority range, that is, a normal service is located. The RRM is furtherconfigured to: when any one condition in the following is met, adjustthe dynamic priority of the current service to a highest priority withinthe first priority range.

The any one condition includes:

after the communication resource has been allocated to the currentservice, a single preemption time of the communication resource byanother service except the current service within a preemptionstatistical period exceeds a first threshold, or after the communicationresource has been allocated to the current service, a total preemptiontime of the communication resource by another service except the currentservice exceeds a second threshold. The preemption statistical period isa second preset time period from a time at which the preemption of thecommunication resource by the another service except the current servicestarts to a time at which the preemption ends. Specifically, after theRRM successively allocates the communication resource according to thedynamic priorities of the second service and the first service, withinthe preemption statistical period, when it is obtained throughstatistics that a single preemption time of the first service exceedsthe first threshold, or when a total preemption time of the firstservice exceeds the second threshold, in this case, it may be regardedthat the resource of the service with infinite duration can no longer bepreempted; otherwise, an execution failure may be caused. Therefore, theRRM adjusts a dynamic priority of the service with infinite duration toa highest priority within the first priority range, that is, within thefirst priority range, no other service may have a priority higher thanthat of the service with infinite duration. Therefore, the communicationresource can be successfully allocated to the service, so as to achievesuccessful execution.

It may be understood that, the preemption statistical period refers to apreset second preset time period from a time at which the preemptionfrom the service with infinite duration starts, that is, it may beregarded that statistics is valid within the preemption statisticalperiod, and if the time period is exceeded, it may be regarded thatstatistics becomes meaningless, and statistics of the previouspreemption time may be reset to zero. It should be noted that, a dynamicpriority range in this embodiment of the present invention includes afirst priority range, a second priority range, and a third priorityrange, where a dynamic priority of the third priority range is less thana dynamic priority of the first priority range, and both the dynamicpriority of the third priority range and the dynamic priority of thefirst priority range are less than a dynamic priority of the secondpriority range.

By means of the solution provided in this embodiment of the presentinvention, after a resource is allocated to a service with infiniteduration in a multiple-card multiple-standby single-pass system by usinga dynamic priority, after a time during which the service is preemptedor interrupted by another service exceeds a particular period of time,the dynamic priority of the service can be directly increased to ahigher level, to avoid a problem that the service fails to be executedbecause the service stays preempted or interrupted by the anotherservice.

In a possible implementation manner, the initial priority of the currentservice is within a first priority range; the dynamic service adjustmentparameter includes a first protection priority; and the calculating, bythe RRM, the dynamic priority of the current service may bespecifically: when a service protection notification for the currentservice is received, calculating the dynamic priority of the currentservice according to the obtained initial priority and the firstprotection priority, where the service protection notification is usedto instruct to ensure that the communication resource is allocated tothe current service, the first protection priority is a highest prioritywithin the first priority range, the calculated dynamic priority of thecurrent service is within a second priority range, and a prioritycorresponding to the second priority range is higher than a prioritycorresponding to the first priority range.

Specifically, when the RRM receives the service protection notificationfor the current service, it indicates that priority protection needs tobe performed on the current service, that is, the dynamic priority needsto be increased. For example, the current service is a radio frequencyprotection task, such as PS domain protection signaling (in the priorart, the PS signaling cannot be lost, and it needs to be ensured thatthe radio frequency resource is allocated). In this case, the dynamicservice adjustment parameter includes a first protection priority, andis mainly configured to increase a protection priority of the service.Further, specifically, the dynamic priority is calculated by using asecond calculation formula, where the second calculation formula is:F=E+(C/N), where F is a dynamic priority, C is an initial priority andis within a first priority range, E is a highest priority within thefirst priority range, and N is a natural number greater than 1. That is,a core purpose of the second calculation formula is that: for a currentservice whose initial priority is a first priority range (low), adynamic priority of the current service is increased from the firstpriority range to the second priority range by using the secondcalculation formula and in combination with the first protectionpriority, so that priorities of normal services are lower than the firstservice, so as to ensure that a resource can be successfully allocatedto the service for successful execution. Further, when differentservices all receive a service protection notification, a service with ahigher initial priority has a higher calculated dynamic priority. It maybe understood that, the initial priority in the second calculationformula in this embodiment of the present invention may be regarded asan initial priority of the current service, or may be regarded as aninitial priority (current dynamic priority) calculated for the currentservice by using the first calculation formula, that is, the initialpriority of the current service may also be updated dynamically, whichis not specifically limited in the present invention.

By means of the solution provided in this embodiment of the presentinvention, a dynamic priority of a service on which radio frequencyprotection needs to be performed and that is in a multiple-cardmultiple-standby single-pass system can be directly increased to ahigher level, to ensure successful execution of the service.

In a possible implementation manner, the current service is a servicewithout a fixed start moment and with finite duration (the RRM mayperform determining according to attribute information carried in theservice, or may perform determining according to a service applicationtype); the dynamic service adjustment parameter includes a protectionremoval priority; and a specific process of calculating the dynamicpriority of the current service by the RRM is: calculating the dynamicpriority of the current service according to the obtained initialpriority and the protection removal priority, where the initial priorityof the current service is within a first priority range, the protectionremoval priority is a lowest priority within the first priority range,the calculated dynamic priority of the current service is within a thirdpriority range, and a priority corresponding to the third priority rangeis lower than a priority corresponding to the first priority range.

Specifically, because an initial priority of the service without a fixedstart moment and with finite duration (such as a group broadcast serviceor a measurement report service that does not strictly require a serviceexecution time) is within the first priority range, and an executionmoment of the task is not strictly required, if resources areinsufficient currently, execution of the service may be postponedappropriately. In this case, the dynamic service adjustment parametermay include a protection removal priority, and the RRM reduces thedynamic priority of the service to the third priority range according tothe obtained initial priority and the protection removal priority, sothat when a service conflict occurs between the service and anotherservice, because a priority of the service has been reduced to a lowerrange, an opportunity of resource allocation may be reserved for anotherservice with a fixed start moment, so as to properly use thecommunication resource. Further, the dynamic service adjustmentparameter further includes a successive allocation failure count, andafter the RRM calculates a first preset time period of the dynamicpriority of the first service by using a third calculation formula andaccording to the obtained initial priority and the first protectionremoval priority, if the dynamic priority of the first service alwaysstays in a low state, no resource can be allocated to the service andthe execution of the service fails. Therefore, after the priority isreduced within an appropriate time period, the priority of the serviceneeds to be restored to a normal state, that is, the RRM calculates thedynamic priority of the first service by using the first calculationformula and according to the obtained initial priority of the firstservice and the successive allocation failure count. For specificcontent of the first calculation formula, refer to other descriptions inthe embodiments of the present invention, and details are not describedherein again.

By means of the solution provided in this embodiment of the presentinvention, a service without a fixed start moment in a multiple-cardmultiple-standby single-pass system is decreased to a particular levelwithin a preset time period, and a resource may be preferentiallyallocated to a service that is with a fixed moment and that may have aservice conflict. Further, in the multiple-card multiple-standbysingle-pass system, after a preset time period, a service that iswithout a fixed start moment and on which service protection removal isperformed is restored to a normal dynamic priority state, so that aresource may also be successfully allocated to the service.

In a possible implementation manner, when the RRM determines that thecurrent service is a periodic service (the RRM may perform determiningaccording to attribute information carried in the service, or mayperform determining according to a service application type), becausethe periodic service is different from a normal service, that is,service application is performed for the periodic service for only once,the RRM performs allocation according to multiple single services atfixed moments, and after a service times out and is released or issuccessfully executed, a single service after a next single service isgenerated. For example, a paging service needs a radio frequencyresource at each fixed moment, and therefore may be regarded as aperiodic service. Specifically, the RRM receives an execution start timeand an execution period (in the prior art, a related scheduling modulealso performs service application at an adjacent moment) of a periodicservice that are sent by a related modem; and after the RRM receives aservice request of the periodic service (the periodic service includesservices at multiple time points, and an interval between services atadjacent time points is a period of the periodic service), a specificprocess of calculating the dynamic priority of the periodic service bythe RRM is: calculating a dynamic priority of a service at an M^(th)time point according to the initial priority of the current service anda successive allocation failure count of a service between a first timepoint and an (M−2)^(th) time point, where an interval between the(M−2)^(th) time point and the Mt time point is two periods of theperiodic service, and M is a natural number greater than 3. When thesuccessive allocation failure count of the service between the firsttime point and the (M−2)^(th) time point is 0, the calculated dynamicpriority of the service at the Mt^(h) time point is equal to an initialpriority of the periodic service; or when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is greater than 0, the calculated dynamic priorityof the service at the M^(th) time point is higher than the initialpriority, and the dynamic priority increases with the increase of thesuccessive allocation failure count.

It is assumed that the periodic service currently performs a servicerequest of the periodic service at the seventh time point. In this case,the RRM needs to calculate a dynamic priority of a service at theseventh (M is 7) time point, and allocate a communication resource tothe service according to the dynamic priority, so that the RRM needs tocalculate the dynamic priority according to a successive allocationfailure count of five services from the service at the first time point(a service at a start time point) to the service at the fifth (7−2=5)time point. The reason lies in that in this embodiment of the presentinvention, after the RRM receives the service request of the periodicservice, inside the RRM, service requests of two services with a fixedmoment and finite duration are simulated, that is, service requests atthe first time point and the second time point. In this case, dynamicpriorities of services at the first time point and the second time pointare the same as the initial priority of the periodic service. Becauseapplication is made for both the services at the first time point andthe second time point for the first time, no previous successiveallocation failure count may be used as reference factors forcalculation of the dynamic priority. When the service at the first timepoint is executed successfully or application for a resource to beallocated fails (an execution failure), a service at the third timepoint is generated (in this case, because a resource application time ofthe service at the second time point is not reached, application for theresource of the service at this time point is not started, that is, adynamic priority of the service at the third time point is only relatedto a resource allocation failure count of services at the first timepoint), and after the service at the second time point is executedsuccessfully or the application for a resource to be allocated fails,service application of a periodic service after a next periodic service(that is, a service at the fourth time point) is immediately generated.In this way, a dynamic priority of a service at the M^(th) time point isalways related to a successive allocation failure count of a servicebetween the first time point and the (M−2)^(th) time point. It should benoted that, when a service that is between the first time point and the(M−2)^(th) time point is executed successfully (that is, when a resourceis successfully allocated), the successive allocation failure count isreset to zero, and calculation starts from a next application failure.In this way, the process is repeated, and for calculation of dynamicpriorities of services at more time points, refer to the foregoingembodiments, and details are not described herein again.

By means of the solution provided in this embodiment of the presentinvention, for a periodic service in a multiple-card multiple-standbysingle-pass system, when a resource fails to be allocated to a periodicservice at one time point, a dynamic priority can be increasedappropriately for a periodic service at a time point after a next timepoint of the time point, so that a resource can be successfullyallocated to the periodic service.

It may be further understood that, in the embodiments of the presentinvention, when the RRM determines that resource allocation of thecurrent service fails, a successive allocation failure parameter A inthe dynamic service adjustment parameter is increased by 1; and when theRRM determines that a resource is successfully allocated to the currentservice, the successive allocation failure parameter in the dynamicservice adjustment parameter is reset to zero.

In the embodiments of the present invention, a communications terminalis provided, including a RF system and a baseband processor, where thebaseband processor is connected to the RF system; the baseband processorincludes: a RRM and at least two modems; and the RRM is configured to:when determining that currently a conflict exists between a firstservice and a second service, compare a first dynamic priority of thefirst service with a second dynamic priority of the second service toallocate a communication resource to one of the first service and thesecond service; the at least two modems include a first modem and asecond modem, where the first modem is configured to process a firstservice of a first subscriber identity module SIM card, the second modemis configured to process a second service of a second SIM card, thefirst service and the second service are configured to preempt acommunication resource, each of the first service and the second serviceis a current service, and the RRM is further configured to calculate adynamic priority of the current service according to an initial priorityof the current service and a dynamic service adjustment parameter. Thecommunications terminal provided in the present invention resolves aproblem in the prior art that improper resource allocation is easilycaused because a multiple-card multiple-standby single-pass systemallocates a communication resource according to only a principle ofperforming allocation by using an initial fixed priority of a service,and avoids a problem such as a call drop or a network disconnectionbecause no resource is allocated to the service for a long time, therebyimproving user experience.

To help understand the solution of the embodiments of the presentinvention, the following provides detailed description with reference tomultiple specific application scenarios. However, it may be understoodthat, the present invention is not limited to the following applicationscenarios. In a specific application scenario, a dynamic priority rangeof a service may be divided into three levels: it is assumed that asmaller priority value indicates a higher priority. For example:

1) a second priority range (high priority): 1 to 99, applicable toservice radio frequency protection (the service radio frequencyprotection refers to that it is ensured for some special services thatradio frequency can be allocated to the services);

2) a first priority range (medium priority): 100 to 900, where 200 to900 are an initial dynamic priority range of a service, and may bespecified to a unit of 10, and 100 is a maximum value calculatedaccording to a dynamic priority. It should be noted that, the initialpriority of the service is set to 200 to 900, and the reason lies inthat in combination with a first calculation formula, both a parameter Cand a parameter D belong to the first priority range, and a calculateddynamic priority range is also within the first priority range. That is,a dynamic priority of a normal service is limited to the first priorityrange by using the calculation formula, so that in a process of radiofrequency protection (increased to the second priority range) orprotection removal (decreased to the third priority range), effects ofprotection and protection removal can be achieved; and

3) the third priority range (low priority): 920 to 1000, which arevalues of a service without a fixed start moment within a period of timerange before application.

For calculation of a dynamic priority for service application, to make apriority of a service dynamically adjustable, during serviceapplication, in addition to the original initial priority (ApplyPriorityrange is within 200 to 900) of the service, two parameters, that is, asuccessive allocation failure count (FailCnt) and a maximum valuethreshold B of a total allocation failure count (FailThd) areparticularly added. The resource allocation module calculates a dynamicpriority F (SchdlPriority) of the service before each time of overallscheduling, and the formula is as follows, where SchdlPriorityMax is amaximum value D of a dynamic priority, and is a fixed parameter, and thefirst calculation formula is

SchdlPriority=ApplyPriority−(ApplyPriority−SchdlPriorityMax)*(FailCnt/FailThd).

FIG. 3 is a change trend of dynamic priorities of a service A whoseinitial priority is 600 and a service B whose initial priority is 400when the successive allocation failure count changes from 0 to 6.

1. For services with a same initial priority, the priorities of theservices gradually increase with an increase of a failure count.

2. For services with different priorities, if failure thresholds of theservices are the same, when failure counts are the same, a priority ofthe service B with a higher priority is still higher than that of theservice A. When application to the resource allocation module is madefor the first time, FailCnt=0, and after allocation to the servicefails, the resource allocation module informs a corresponding modem, andthe modem keeps count of FailCnt of the corresponding service, andcarried FailCnt is increased when application is made a next time. Theresource allocation module performs calculation according to a formula,so as to increase SchdlPriority. If still no resource is allocated, themodem continues to add 1 to FailCnt of the corresponding service. Afterallocation to the service succeeds, the corresponding modem is informed,and the modem resets FailCnt to zero, and the resource allocation moduleperforms calculation again by using the formula, so as to restore thedynamic priority to an application value. For example, if a modem 1 anda modem 2 reside on a same cell and separately have a paging service(assuming that another service is not considered temporarily) that needsto use a radio frequency resource, the modem 1 and the modem 2simultaneously make application for the paging service. Priorities ofservices in a same mode such as a mode G are the same. It is assumedthat an initial priority ApplyPriority of the paging service is 500, thetotal allocation failure count FailThd is 5, and the successiveallocation failure count FailCnt is 0. A specific procedure is asfollows:

1. Application paging service parameters of the modem 1 are:ApplyPriorityM1=500, FailThdM1=5, and FailCntM1=0; and applicationpaging service parameters of the modem 2 are: ApplyPriorityM2=500,FailThdM2=5, and FailCntM2=0;

2. after a service application of each mode is received, the RRMcalculates priorities scheduled by the RRM:SchdlPriorityM1=500−(500−100)*(0/5)=500, andSchdlPriorityM2=500−(500−100)*(0/5)=500;

3. because the two priorities are the same, the RRM performs allocationaccording to a sequence of the modems (SIM cards) (according to asequence from the modem 1 to the modem 2), that is, the RRMpreferentially allocates a resource to the modem 1, and informs themodem 2 of a failure of allocation to the modem 2; in this case, themodem 2 adds 1 to the parameter FailCntM2 of the modem 2 according tothe failure of allocation;

4. at a next paging position, the modem 1 and the modem 2 simultaneouslymake application for a service, where application paging serviceparameters of the modem 1 are: ApplyPriorityM1=500, FailThdM1=5, andFailCntM1=0; and application paging service parameters of the modem 2are: ApplyPriorityM2=500, FailThdM2=5, and FailCntM2=1;

5. after receiving a service application of each mode, the RRMcalculates priorities scheduled by the RRM:SchdlPriorityM1=500−(500−100)*(0/5)=500, andSchdlPriorityM2=500−(500−100)*(1/5)=420;

6. because a priority of the modem 2 is higher than that of the modem 1,the RRM preferentially allocates a resource to the modem 2, and informsthe modem 1 of a failure of allocation to the modem 1, the modem 1 adds1 to a parameter FailCntM1 of the modem 1 according to the allocationfailure, and the modem 2 resets a corresponding value FailCntM2 to zerobecause allocation succeeds;

7. at a next paging position, the modem 1 and the modem 2 simultaneouslymake application for a service; application paging service parameters ofthe modem 1 are: ApplyPriorityM2=500, FailThdM2=5, and FailCntM2=1; andapplication paging service parameters of the modem 2 are:ApplyPriorityM1=500, FailThdM1=5, and FailCntM1=0; and

8. after a service application in each mode is received, the RRMcalculates priorities scheduled by the RRM, and allocates a serviceSchdlPriorityM1=500−(500−100)*(1/5)=420 to the modem 1 andSchdlPriorityM2=500−(500−100)*(0/5)=500 to the modem 2; therefore, asshown in FIG. 4, the communication resource may be used cyclically bythe modem 1 and the modem 2.

In another specific application scenario, when a service type is aservice without a fixed start moment, within a period of time such as 50ms before application is made for the service without a fixed startmoment, a priority of the service is within a low priority range, and itis ensured as much as possible that a resource is preferentiallyallocated to a service with a fixed start moment, that is, a thirdcalculation formula in this embodiment of the present invention is used,and is specifically as follows:

SchdlPriority=ApplyPriortyMin+ApplyPriority/10, where

ApplyPriortyMin is a lowest priority 1000 within all priority ranges.After the period of time 50 ms, the dynamic priority of the service isrecalculated according to the first calculation formula, and is keptbetween 100 and 900.

In still another specific application scenario, when a type of a serviceis a radio frequency protection service for priority processing, theservice sends a radio frequency protection message during PS signalingprotection of a call service (PS signaling cannot be lost, and it needsto be ensured that a radio frequency can be allocated), and the resourceallocation module increases a priority of a service corresponding to amodem to a radio frequency protection range (21 to 91). RF Protect maybe performed on multiple modems, and to distinguish priorities ofmultiple radio frequency protection services, fine adjustment isperformed on a dynamic priority of the service by using an applicationvalue of the dynamic priority, that is, a second calculation formula inthis embodiment of the present invention is used, which is specificallyas follows:

SchdlPriority=SchdlPriorityHighest+ApplyPriority/10, where

an application range of ApplyPriority is 200 to 900, and a value ofSchdlPriorityHighest is 1; therefore, when radio frequency protection isperformed, a range of calculated dynamic priorities is 21 to 91.

If radio frequency protection is performed on both the modems, forexample, an initial priority of the modem 1 is 300, and an initialpriority of the modem 2 is 500, it may be calculated that the scheduledSchdlPriorityM1 is 31, and the scheduled SchdlPriorityM2 is 51. Althoughradio frequency protection is performed on both the modems, the dynamicpriorities are increased to a high priority range, but are stilldistinguished according to the application values of the dynamicpriorities.

In yet another specific application scenario, as shown in FIG. 5, whenthe first service is a service with infinite duration, the servicecarries a single preemption time PrmptTimeThd, a total preemption timeTotalPrmptTimeThd, and a preemption statistical period PrmptPeriod,which are used to calculate a point at which the priority of the serviceis increased to a maximum value 100, and at the point, allocation may bepreferentially performed on the service.

For example, the service with infinite duration is a data service. Dueto a relatively low priority of the data service, the data service maybe interrupted multiple times. However, to prevent the service frombeing interrupted all the time, three parameters are set:

a single preemption time PrmptTimeThd;

a total preemption time TotalPrmptTimeThd; and

a preemption statistical period PrmptPeriod.

When a particular condition is met, a priority of the data service isincreased to 100 (that is, a maximum value besides a radio frequencyprotection value), and allocation to a PS service may be performedthereafter.

For example, PrmptPeriod=200 ms; PrmptTimeThd=60 ms; and

TotalPrmptTimeThd=100 ms; in addition, three parameters: a preemptionmoment PrmptStartPos, a total interruption time TotalPrmptTime, and asingle interruption time PrmptTime, are set for intermediatecalculation.

When the data service is interrupted, a current moment is assigned as avalue to PrmptPos, and an entire preemption period PrmptPoslnPeriod alsostarts to be timed. When preemption ends, a currentPrmptTime=PrmptEndPos−PrmptStartPos is recorded according to an endmoment PrmptEndPos.

When scheduling is started each time, whether a time from the currenttime to PrmptPosInPeriod exceeds PrmptPeriod is determined; if the timeexceeds PrmptPeriod, the total preemption time is reset to zero.

If PrmptTime>=PrmptTimeThd or TotalPrmptTime>=TotalPrmptTimeThd, a PSpriority is increased to 100.

If TotalPrmptTime<TotalPrmptTimeThd, a service priority is keptunchanged, and TotalPrmptTime+=PrmptTime.

When interruption is performed again, the preemption moment and the endmoment are updated, and PrmptTime and TotalPrmptTime are calculated.

In conclusion, there are there cases in total:

As shown by A in FIG. 5, the single preemption time exceeds the singlepreemption threshold, so that a priority at a position is increased to100.

As shown by B in FIG. 5, the single preemption time is short, butbecause preemption is performed multiple times within a preemptionperiod, the total preemption time exceeds TotalPrmptTimeThd, and apriority at a position is increased to 100.

As shown by C in FIG. 5, although preemption is performed multipletimes, the preemption time is short and is insufficient to increase apriority of the service. The preemption time in the three figures isreset to zero when PrmptPeriod ends.

In yet another specific application scenario, as shown in FIG. 6, whenthe first service is a periodic service, because the periodic serviceapplies for a resource only once, the RRM performs allocation accordingto that the period service is a single service having multiple fixedstart moments. After the service times out and is released or issuccessfully executed, a single service (time point service) after anext single service is generated.

A paging service needs a radio frequency resource at each fixedposition, and therefore, the paging service may be regarded as aperiodic service to apply for the radio frequency resource. Ifallocation fails for the single service of the periodic service, FailCntcounting is performed inside the resource allocation module, and apriority of the single service in subsequent allocation is affected.

After the RRM receives application for the periodic service, the RRMinternally simulates that application content of two services that areequivalent to the periodic service and that have fixed moment and withfinite duration separately needs to use resources at positions and . Ifservice allocation at fails, a service application of using a radiofrequency resource at is directly generated, and a time point service atis calculated by using the Failcnt being 1. For a specific calculationformula, refer to the first calculation formula. Compared with thesingle service, in the periodic service, there is no interaction betweenthe RRM and the modem, and for each modem, implementation is simpler.For more specific implementation details and more actual applicationscenarios, refer to the foregoing method embodiments in FIG. 1 and FIG.2, and details are not described herein again.

Referring to FIG. 7, a schematic structural diagram of a resourceallocation apparatus in an embodiment of the present invention isdescribed in detail. The apparatus 20 is applied to a terminal includinga RF system and a baseband processor, and specifically may be applied toa baseband processor 12 of a communications terminal 10 in FIG. 1, or beused as some functional modules in a RRM 123 of the baseband processor12 to complete related functions such as resource scheduling andallocation of a service. The apparatus 20 may include: a receivingmodule 201 and an allocation module 210.

The baseband processor includes the RRM and at least two modems, and theat least two modems include a first modem and a second modem.

The receiving module 201 is configured to receive a service request thatis of a first service and that is initiated by the first modem, wherethe first modem is configured to process a first service of a firstsubscriber identity module SIM card.

The allocation module 210 is configured to: when determining that therecurrently exists a second service that is initiated by the second modemand that is in a conflict with the first service in preempting acommunication resource, compare a first dynamic priority of the firstservice with a second dynamic priority of the second service to allocatethe communication resource to one of the first service and the secondservice, where the second modem is configured to process the secondservice of a second SIM card, the communication resource includes aresource formed by the RF system, each of the first service and thesecond service is a current service, a dynamic priority of the currentservice is calculated by the RRM according to an initial priority of thecurrent service and a dynamic service adjustment parameter.

Specifically, as shown in FIG. 8, which is a schematic structuraldiagram of another embodiment of a resource allocation apparatusprovided in the present invention, the resource allocation apparatus 20may further include: a first priority calculation module 202.

The dynamic service adjustment parameter includes a successiveallocation failure count, the successive allocation failure count refersto a quantity of successive failures in applying for the communicationresource to be allocated to the current service, and upon a success inapplying for the communication resource to be allocated, the successiveallocation failure count is reset to zero.

The first priority calculation module 202 is configured to: whendetermining that the current service meets any one condition in thefollowing, calculate, the dynamic priority of the current serviceaccording to the initial priority of the current service and thesuccessive allocation failure count, where when the successiveallocation failure count is 0, the calculated dynamic priority is equalto the initial priority; or when the successive allocation failure countis greater than 0, the calculated dynamic priority is higher than theinitial priority, and the dynamic priority increases with the increaseof the successive allocation failure count.

The any one condition includes:

the current service is a service with a fixed start moment, or a servicewithout a fixed start moment and with infinite duration; or

the current service is a service without a fixed start moment and withfinite duration, and the dynamic priority of the current service remainswithin a third priority range within a first preset time period after aservice request is initiated, where the initial priority of the currentservice is within a first priority range, and a priority correspondingto the third priority range is lower than a priority corresponding tothe first priority range; or

when the dynamic priority of the current service is within a secondpriority range, and the RRM receives a service protection removalnotification for the current service, where the service protectionremoval notification instructs to adjust the dynamic priority of thecurrent service from the second priority range to a first priorityrange, and a priority corresponding to the second priority range ishigher than a priority corresponding to the first priority range.

Further, as shown in FIG. 9, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a first calculation module 203.

The first calculation module 203 is configured to calculate the firstdynamic priority according to a first calculation formula, where thefirst calculation formula is: F=C−(C−D)*(A/B), where F is a dynamicpriority, C is an initial priority and is within a first priority range,D is a highest priority within the first priority range, A is asuccessive allocation failure count, B is a maximum threshold of thesuccessive allocation failure count, a priority of C is lower than thatof D, and A is less than B.

Further, as shown in FIG. 10, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a second priority calculation module 204.

The current service is a service with infinite duration.

The second priority calculation module 204 is configured to: when anyone condition in the following is met, adjust the dynamic priority ofthe current service to a highest priority within a first priority range,where the initial priority of the current service is within the firstpriority range.

The any one condition includes:

after the communication resource has been allocated to the currentservice, a single preemption time of the communication resource byanother service except the current service within a preemptionstatistical period exceeds a first threshold, where the preemptionstatistical period is a second preset time period from a time at whichthe preemption of the communication resource by the another serviceexcept the current service starts to a time at which the preemptionends; or

after the communication resource has been allocated to the currentservice, a total preemption time of the communication resource byanother service except the current service exceeds a second threshold.

Further, as shown in FIG. 11, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a third priority calculation module 205.

The initial priority of the current service is within a first priorityrange, and the dynamic service adjustment parameter includes a firstprotection priority.

The third priority calculation module 205 is configured to: when aservice protection notification for the current service is received,calculate the dynamic priority of the current service according to theobtained initial priority and the first protection priority, where theservice protection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, the firstprotection priority is a highest priority within the first priorityrange, the calculated dynamic priority of the current service is withina second priority range, and a priority corresponding to the secondpriority range is higher than a priority corresponding to the firstpriority range.

Further, as shown in FIG. 12, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a second calculation module 206.

The second calculation module 206 is configured to: when a serviceprotection notification for the current service is received, calculatethe dynamic priority of the current service according to a secondcalculation formula, where the service protection notification is usedto instruct to ensure that the communication resource is allocated tothe current service, and the second calculation formula is: F=E+(C/N),where F is a dynamic priority, C is an initial priority and is within afirst priority range, E is a highest priority within the first priorityrange, and N is a natural number greater than 1.

Further, as shown in FIG. 13, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a fourth priority calculation module 207.

The current service is a service without a fixed start moment and finiteduration, and the dynamic service adjustment parameter includes aprotection removal priority

The fourth priority calculation module 207 is configured to calculatethe dynamic priority of the current service according to the obtainedinitial priority and the protection removal priority, where the initialpriority of the current service is within a first priority range, theprotection removal priority is a lowest priority within the firstpriority range, the calculated dynamic priority of the current serviceis within a third priority range, and a priority corresponding to thethird priority range is lower than a priority corresponding to the firstpriority range.

The calculated dynamic priority increases with the increase of theinitial priority of the current service.

Further, as shown in FIG. 14, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a third calculation module 208.

The current service is a service without a fixed start moment and withfinite duration.

The third calculation module 208 is configured to calculate the dynamicpriority of the current service according to a third calculationformula, where the third calculation formula is: F=E+(C/N), where F is adynamic priority, C is an initial priority and is within a firstpriority range, E is a lowest priority within the first priority range,and N is a natural number greater than 1.

Further, as shown in FIG. 15, which is a schematic structural diagram ofstill another embodiment of a resource allocation apparatus provided inthe present invention, the resource allocation apparatus 20 may furtherinclude: a fifth priority calculation module 209.

The current service is a periodic service, the periodic service includesservices at multiple time points, and an interval between services atadjacent time points is a period of the periodic service; and theapparatus further includes:

a fifth priority calculation module 209, configured to calculate adynamic priority of a service at an M^(th) time point according to theinitial priority of the current service and a successive allocationfailure count of a service between a first time point and an (M−2)^(th)time point, where an interval between the (M−2)^(th) time point and theM^(th) time point is two periods of the periodic service, and M is anatural number greater than 3, where when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is 0, the calculated dynamic priority of theservice at the M^(th) time point is equal to an initial priority of theperiodic service; or when the successive allocation failure count of theservice between the first time point and the (M−2)^(th) time point isgreater than 0, the calculated dynamic priority of the service at theM^(th) time point is higher than the initial priority, and the dynamicpriority increases with the increase of the successive allocationfailure count.

This embodiment of the present invention provides the resourceallocation apparatus, applied to a multiple-card multiple-standbysingle-pass system terminal including a RF system and a basebandprocessor, where the apparatus includes: the receiving module and theallocation module, where the receiving module is configured to receive aservice request that is of a first service and that is initiated by afirst modem; and the allocation module is configured to: whendetermining that there currently exists a second service that isinitiated by a second modem and that is in a conflict with the firstservice in preempting a communication resource, compare a first dynamicpriority of the first service with a second dynamic priority of thesecond service to allocate the communication resource to one of thefirst service and the second service. The resource allocation apparatusprovided in the present invention resolves a problem in the prior artthat improper resource allocation is easily caused because amultiple-card multiple-standby single-pass system allocates acommunication resource according to only a principle of performingallocation by using an initial fixed priority of a service, and avoids aproblem such as a call drop or a network disconnection because noresource is allocated to the service for a long time, thereby improvinguser experience.

It may be understood that, for functions of the modules in the resourceallocation apparatus 20, refer to specific implementation manners of theforegoing communications terminal and method embodiment in FIG. 1 andFIG. 2, and details are not described herein again.

It should be noted that, the foregoing method embodiment of the presentinvention may be further applied to various types of processors, orimplemented by a processor. The processor may be an integrated circuitchip and has a signal processing capability. In an implementationprocess, steps in the foregoing method embodiments can be implemented byusing a hardware integrated logical circuit in the processor, or byusing instructions in a form of software. The processor may be a generalpurpose processor, a digital signal processor (Digital Signal Processor,DSP), an application specific integrated circuit (Application SpecificIntegrated Circuit, ASIC), a field programmable gate array (FieldProgrammable Gate Array, FPGA) or another programmable logical device, adiscrete gate or transistor logic device, or a discrete hardwarecomponent. The processor may implement or execute methods, steps andlogical block diagrams disclosed in the embodiments of the presentinvention. The general-purpose processor may be a microprocessor, or theprocessor may further be any conventional processor, or the like. Stepsof the methods disclosed with reference to the embodiments of thepresent invention may be directly executed and accomplished by means ofa hardware decoding processor, or may be executed and accomplished byusing a combination of hardware and software modules in the decodingprocessor. A software module may be located in a mature storage mediumin the art, such as a random access memory, a flash memory, a read-onlymemory, a programmable read-only memory, an electrically erasableprogrammable memory, a register, or the like. The storage medium islocated in the memory, and a processor reads information in the memoryand completes the steps in the foregoing methods in combination withhardware of the processor.

It may be understood that, the memory in this embodiment of the presentinvention may be a volatile memory or a non-volatile memory, or mayinclude both a volatile memory and a non-volatile memory. Thenon-volatile memory may be a read-only memory (Read-Only Memory, ROM), aprogrammable read-only memory (Programmable ROM, PROM), an erasableprogrammable read-only memory (Erasable PROM, EPROM), an electricallyerasable programmable read-only memory (Electrically EPROM, EEPROM), ora flash memory. The volatile memory may be a random access memory(Random Access Memory, RAM), and is used as an external cache. It isdescribed as an example but not a limitation, many forms of RAMs, forexample, a static random access memory (Static RAM, SRAM), a dynamicrandom access memory (Dynamic RAM, DRAM), a synchronous dynamic randomaccess memory (Synchronous DRAM, SDRAM), a double data rate synchronousdynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), anenhanced synchronous dynamic random access memory (Enhanced SDRAM,ESDRAM), a synchlink dynamic random access memory (Synchlink DRAM,SLDRAM), and a direct rambus random access memory (Direct Rambus RAM, DRRAM), may be used. It should be noted that, the memory of the system andthe method described in this specification includes, but is not limitedto, these and any other suitable types of memories.

Persons of ordinary skill in the art may be aware that, in combinationwith the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. Persons skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of the present invention.

It may be clearly understood by persons skilled in the art that, for thepurpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, reference may bemade to a corresponding process in the foregoing method embodiments, anddetails are not described.

An embodiment of the present invention further provides a computerstorage medium, where the computer storage medium may store a program,and when the program is executed, a part or all of the steps in theresource allocation method recorded in the method embodiment areperformed.

In the foregoing embodiments, the description of each embodiment hasrespective focuses. For a part that is not described in detail in anembodiment, reference may be made to related descriptions in otherembodiments.

It should be noted that, to make the description brief, the foregoingmethod embodiments are expressed as a series of actions. However,persons skilled in the art should appreciate that the present inventionis not limited to the described action sequence, because according tothe present invention, some steps may be performed in other sequences orperformed simultaneously. In addition, persons skilled in the art shouldalso appreciate that all the embodiments described in the specificationare exemplary embodiments, and the related actions and modules are notnecessarily mandatory to the present invention.

In the several embodiments provided in the present application, itshould be understood that the disclosed apparatus may be implemented inother manners. For example, the described apparatus embodiment is merelyexemplary. For example, the unit division is merely logical functiondivision and may be other division in actual implementation. Forexample, a plurality of units or components may be combined orintegrated into another system, or some features may be ignored or notperformed. In addition, the displayed or discussed mutual connections ordirect couplings may be implemented through some interfaces. Theindirect couplings or communication connections between the apparatusesor units may be implemented in electronic or other forms, which are notlimited to connections directly by using conducting wires.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected according toactual needs to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of the presentinvention may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units are integratedinto one unit. The integrated unit may be implemented in a form ofhardware, or may be implemented in a form of a software functional unit.

When the foregoing integrated unit is implemented in the form of asoftware functional unit and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of the presentinvention essentially, or the part contributing to the prior art, or allor a part of the technical solutions may be implemented in the form of asoftware product. The software product is stored in a storage medium andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, or a network device, and may bespecifically a processor in a computer device) to perform all or a partof the steps of the foregoing methods described in the embodiments ofthe present invention. The foregoing storage medium includes: any mediumthat can store program code, such as a USB flash drive, a removable harddisk, a magnetic disk, an optical disc, a read-only memory (English:Read-Only Memory, ROM for short), or a random access memory (English:Random Access Memory, RAM for short).

The foregoing embodiments are merely intended for describing thetechnical solutions of the present invention, but not for limiting thepresent invention. Although the present invention is described in detailwith reference to the foregoing embodiments, persons of ordinary skillin the art should understand that they may still make modifications tothe technical solutions described in the foregoing embodiments or makeequivalent replacements to some technical features thereof, withoutdeparting from the spirit and scope of the technical solutions of theembodiments of the present invention.

What is claimed is:
 1. A communications terminal, comprising a radiofrequency (RF) system and a baseband processor, wherein the basebandprocessor is connected to the RF system, the baseband processorcomprises: a radio resource manager (RRM) and at least two modems, andthe at least two modems comprise a first modem and a second modem; thefirst modem is configured to process a first service of a firstsubscriber identity module (SIM) card; the second modem is configured toprocess a second service of a second SIM card; and the RRM is configuredto: receive a service request that is of the first service and that isinitiated by the first modem; receive a service request that is of thesecond service and that is initiated by the second modem, wherein thefirst service and the second service are configured to preempt acommunication resource; and when determining that currently a conflictexists between the first service and the second service, compare a firstdynamic priority of the first service with a second dynamic priority ofthe second service to allocate the communication resource to one of thefirst service and the second service, wherein the communication resourcecomprises a resource formed by the RF system, each of the first serviceand the second service is a current service, and the RRM is furtherconfigured to calculate a dynamic priority of the current serviceaccording to an initial priority of the current service and a dynamicservice adjustment parameter.
 2. The terminal according to claim 1,wherein the RF system comprises a radio frequency integrated circuit(RFIC), and the RFIC is configured to modulate or demodulate an RFsignal related to a service processed by any one of the at least twomodems.
 3. The terminal according to claim 2, wherein the RF systemfurther comprises an antenna and a radio frequency front end (RFFE), theantenna is connected to the RFFE, the RFFE is connected to the RFIC, andthe RFFE receives or sends the RF signal using the antenna.
 4. Theterminal according to claim 1, wherein the dynamic service adjustmentparameter comprises a successive allocation failure count, thesuccessive allocation failure count refers to a quantity of successivefailures in applying for the communication resource to be allocated tothe current service, and upon a success in applying for thecommunication resource to be allocated, the successive allocationfailure count is reset to zero; and during the calculation of thedynamic priority of the current service, the RRM is further configuredto: when determining that the current service satisfies any onecondition, calculate the dynamic priority of the current serviceaccording to the initial priority of the current service and thesuccessive allocation failure count, wherein when the successiveallocation failure count is 0, the calculated dynamic priority is equalto the initial priority; or when the successive allocation failure countis greater than 0, the calculated dynamic priority is higher than theinitial priority, and the dynamic priority increases with the increaseof the successive allocation failure count; and wherein the any onecondition comprises: the current service is a service with a fixed startmoment, or a service without a fixed start moment and with infiniteduration; or the current service is a service without a fixed startmoment and with finite duration, and the dynamic priority of the currentservice remains within a third priority range within a first preset timeperiod after a service request is initiated, wherein the initialpriority of the current service is within a first priority range, and apriority corresponding to the third priority range is lower than apriority corresponding to the first priority range; or the dynamicpriority of the current service is within a second priority range, andthe RRM receives a service protection removal notification for thecurrent service, wherein the service protection removal notificationinstructs to adjust the dynamic priority of the current service from thesecond priority range to a first priority range, and a prioritycorresponding to the second priority range is higher than a prioritycorresponding to the first priority range.
 5. The terminal according toclaim 1, wherein during the calculation of the dynamic priority of thecurrent service, the RRM is further configured to: calculate the firstdynamic priority according to a first calculation formula, wherein thefirst calculation formula is: F=C−(C−D)*(A/B), wherein F is a dynamicpriority, C is an initial priority and is within a first priority range,D is a highest priority within the first priority range, A is asuccessive allocation failure count, B is a maximum threshold of thesuccessive allocation failure count, a priority of C is lower than thatof D, and A is less than B.
 6. The terminal according to claim 1,wherein the current service is a service with infinite duration, and theRRM is further configured to: when any one condition is satisfied,adjust the dynamic priority of the current service to a highest prioritywithin a first priority range, wherein the initial priority of thecurrent service is within the first priority range; and wherein the anyone condition comprises: after the communication resource has beenallocated to the current service, a single preemption time of thecommunication resource by another service except the current servicewithin a preemption statistical period exceeds a first threshold,wherein the preemption statistical period is a second preset time periodfrom a time at which the preemption of the communication resource by theanother service except the current service starts to a time at which thepreemption ends; or after the communication resource has been allocatedto the current service, a total preemption time of the communicationresource by another service except the current service exceeds a secondthreshold.
 7. The terminal according to claim 1, wherein the initialpriority of the current service is within a first priority range; thedynamic service adjustment parameter comprises a first protectionpriority; and during the calculation of the dynamic priority of thecurrent service, the RRM is further configured to: when a serviceprotection notification for the current service is received, calculatethe dynamic priority of the current service according to the obtainedinitial priority and the first protection priority, wherein the serviceprotection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, the firstprotection priority is a highest priority within the first priorityrange, the calculated dynamic priority of the current service is withina second priority range, and a priority corresponding to the secondpriority range is higher than a priority corresponding to the firstpriority range.
 8. The terminal according to claim 1, wherein during thecalculation of the dynamic priority of the current service, the RRM isfurther configured to: when a service protection notification for thecurrent service is received, calculate the dynamic priority of thecurrent service using a second calculation formula, wherein the serviceprotection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, and thesecond calculation formula is: F=E+(C/N), wherein F is a dynamicpriority, C is an initial priority and is within a first priority range,E is a highest priority within the first priority range, and N is anatural number greater than
 1. 9. The terminal according to claim 1,wherein the current service is a service without a fixed start momentand with finite duration; the dynamic service adjustment parametercomprises a protection removal priority; and during the calculation ofthe dynamic priority of the current service, the RRM is furtherconfigured to: calculate the dynamic priority of the current serviceaccording to the obtained initial priority and the protection removalpriority, wherein the initial priority of the current service is withina first priority range, the protection removal priority is a lowestpriority within the first priority range, the calculated dynamicpriority of the current service is within a third priority range, and apriority corresponding to the third priority range is lower than apriority corresponding to the first priority range.
 10. The terminalaccording to claim 1, wherein the current service is a service without afixed start moment and with finite duration; and during the calculationof the dynamic priority of the current service, the RRM is furtherconfigured to: calculate the dynamic priority of the current serviceaccording to a third calculation formula, wherein the third calculationformula is: F=E+(C/N), wherein F is a dynamic priority, C is an initialpriority and is within a first priority range, E is a lowest prioritywithin the first priority range, and N is a natural number greaterthan
 1. 11. The terminal according to claim 1, wherein the currentservice is a periodic service, the periodic service comprises servicesat multiple time points, and an interval between services at adjacenttime points is a period of the periodic service; and the RRM is furtherconfigured to: calculate a dynamic priority of a service at an M^(th)time point according to the initial priority of the current service anda successive allocation failure count of a service between a first timepoint and an (M−2)th time point, wherein an interval between the(M−2)^(th) time point and the M^(th) time point is two periods of theperiodic service, and M is a natural number greater than 3, wherein whenthe successive allocation failure count of the service between the firsttime point and the (M−2)th time point is 0, the calculated dynamicpriority of the service at the M^(th) time point is equal to an initialpriority of the periodic service; or when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is greater than 0, the calculated dynamic priorityof the service at the M^(th) time point is higher than the initialpriority, and the dynamic priority increases with the increase of thesuccessive allocation failure count.
 12. A resource allocation method,applied to a terminal comprising a radio frequency (RF) system and abaseband processor, wherein the baseband processor comprises a radioresource manager (RRM) and at least two modems, the at least two modemscomprise a first modem and a second modem, and the method comprises:receiving, by the RRM, a service request that is of a first service andthat is initiated by the first modem, wherein the first modem isconfigured to process a first service of a first subscriber identitymodule (SIM) card; when the RRM determines that there currently exists asecond service that is initiated by the second modem and that is in aconflict with the first service in preempting a communication resource,comparing a first dynamic priority of the first service with a seconddynamic priority of the second service to allocate the communicationresource to one of the first service and the second service, wherein thesecond modem is configured to process the second service of a second SIMcard, the communication resource comprises a resource formed by the RFsystem, each of the first service and the second service is a currentservice, and a dynamic priority of the current service is calculated bythe RRM according to an initial priority of the current service and adynamic service adjustment parameter.
 13. The method according to claim12, wherein the dynamic service adjustment parameter comprises asuccessive allocation failure count, the successive allocation failurecount refers to a quantity of successive failures in applying for thecommunication resource to be allocated to the current service, and upona success in applying for the communication resource to be allocated,the successive allocation failure count is reset to zero; and the methodfurther comprises: when the RRM determines that the current servicesatisfies any one condition, calculating, by the RRM, the dynamicpriority of the current service according to the initial priority of thecurrent service and the successive allocation failure count, whereinwhen the successive allocation failure count is 0, the calculateddynamic priority is equal to the initial priority; or when thesuccessive allocation failure count is greater than 0, the calculateddynamic priority is higher than the initial priority, and the dynamicpriority increases with the increase of the successive allocationfailure count; and wherein the any one condition comprises: the currentservice is a service with a fixed start moment, or a service without afixed start moment and with infinite duration; or the current service isa service without a fixed start moment and with finite duration, and thedynamic priority of the current service remains within a third priorityrange within a first preset time period after a service request isinitiated, wherein the initial priority of the current service is withina first priority range, and a priority corresponding to the thirdpriority range is lower than a priority corresponding to the firstpriority range; or when the dynamic priority of the current service iswithin a second priority range, and the RRM receives a serviceprotection removal notification for the current service, wherein theservice protection removal notification instructs to adjust the dynamicpriority of the current service from the second priority range to afirst priority range, and a priority corresponding to the secondpriority range is higher than a priority corresponding to the firstpriority range.
 14. The method according to claim 12, wherein the methodfurther comprises: calculating, by the RRM, the first dynamic priorityaccording to a first calculation formula, wherein the first calculationformula is: F=C−(C−D)*(A/B), wherein F is a dynamic priority, C is aninitial priority and is within a first priority range, D is a highestpriority within the first priority range, A is a successive allocationfailure count, B is a maximum threshold of the successive allocationfailure count, a priority of C is lower than that of D, and A is lessthan B.
 15. The method according to claim 12, wherein the currentservice is a service with infinite duration, and the method furthercomprises: when any one condition is satisfied, adjusting, by the RRM,the dynamic priority of the current service to a highest priority withina first priority range, wherein the initial priority of the currentservice is within the first priority range; and wherein the any onecondition comprises: after the communication resource has been allocatedto the current service, a single preemption time of the communicationresource by another service except the current service within apreemption statistical period exceeds a first threshold, wherein thepreemption statistical period is a second preset time period from a timeat which the preemption of the communication resource by the anotherservice except the current service starts to a time at which thepreemption ends; or after the communication resource has been allocatedto the current service, a total preemption time of the communicationresource by another service except the current service exceeds a secondthreshold.
 16. The method according to claim 12, wherein the initialpriority of the current service is within a first priority range; thedynamic service adjustment parameter comprises a first protectionpriority; and the method further comprises: when the RRM receives aservice protection notification for the current service, calculating, bythe RRM, the dynamic priority of the current service according to theobtained initial priority and the first protection priority, wherein theservice protection notification is used to instruct to ensure that thecommunication resource is allocated to the current service, the firstprotection priority is a highest priority within the first priorityrange, the calculated dynamic priority of the current service is withina second priority range, and a priority corresponding to the secondpriority range is higher than a priority corresponding to the firstpriority range.
 17. The method according to claim 12, wherein the methodfurther comprises: when the RRM receives a service protectionnotification for the current service, calculating, by the RRM, thedynamic priority of the current service according to a secondcalculation formula, wherein the service protection notification is usedto instruct to ensure that the communication resource is allocated tothe current service, and the second calculation formula is: F=E+(C/N),wherein F is a dynamic priority, C is an initial priority and is withina first priority range, E is a highest priority within the firstpriority range, and N is a natural number greater than
 1. 18. The methodaccording to claim 12, wherein the current service is a service withouta fixed start moment and with finite duration; the dynamic serviceadjustment parameter comprises a protection removal priority; and themethod further comprises: calculating, by the RRM, the dynamic priorityof the current service according to the obtained initial priority andthe protection removal priority, wherein the initial priority of thecurrent service is within a first priority range, the protection removalpriority is a lowest priority within the first priority range, thecalculated dynamic priority of the current service is within a thirdpriority range, and a priority corresponding to the third priority rangeis lower than a priority corresponding to the first priority range. 19.The method according to claim 12, wherein the current service is aservice without a fixed start moment and with finite duration, and themethod further comprises: calculating, by the RRM, the dynamic priorityof the current service using a third calculation formula, wherein thethird calculation formula is: F=E+(C/N), wherein F is a dynamicpriority, C is an initial priority and is within a first priority range,E is a lowest priority within the first priority range, and N is anatural number greater than
 1. 20. The method according to claim 12,wherein the current service is a periodic service, the periodic servicecomprises services at multiple time points, and an interval betweenservices at adjacent time points is a period of the periodic service;and the method further comprises: calculating, by the RRM, a dynamicpriority of a service at an Mt^(th) time point according to the initialpriority of the current service and a successive allocation failurecount of a service between a first time point and an (M−2)^(th) timepoint, wherein an interval between the (M−2)^(th) time point and theM^(th) time point is two periods of the periodic service, and M is anatural number greater than 3, wherein when the successive allocationfailure count of the service between the first time point and the(M−2)^(th) time point is 0, the calculated dynamic priority of theservice at the M^(th) time point is equal to an initial priority of theperiodic service; or when the successive allocation failure count of theservice between the first time point and the (M−2)^(th) time point isgreater than 0, the calculated dynamic priority of the service at theM^(th) time point is higher than the initial priority, and the dynamicpriority increases with the increase of the successive allocationfailure count.